package com.ciwong.epaper.widget.catalog;

import com.ciwong.epaper.widget.catalog.base.BaseNode;
import com.ciwong.epaper.modules.me.bean.CatalogueUnitBean;

public class CatalogNode extends BaseNode<String,CatalogueUnitBean> {

    public CatalogNode(String parentId,String selfId,CatalogueUnitBean itemContent){
        setParentId(parentId);
        setSelfId(selfId);
        setNodeContent(itemContent);
    }
    @Override
    public boolean isChildOf(BaseNode desNode) {
        return getParentId()==desNode.getSelfId()||getParentId().equals(desNode.getSelfId());
    }

    @Override
    public boolean isParentOf(BaseNode desNode) {
        return getSelfId()==desNode.getParentId()||getSelfId().equals(desNode.getParentId());
    }
}
